﻿
using _11_新语法;

// Console.WriteLine("Hello, World!");
// string s = await File.ReadAllTextAsync("1.txt");
// A();
// Console.WriteLine(6666);

//Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory+"1.txt");、
var path = AppDomain.CurrentDomain.BaseDirectory + "1.txt";
{
    using var fs = File.OpenWrite(path);
    using var write = new StreamWriter(fs);
    Console.WriteLine("请输入信息");
    write.WriteLine(Console.ReadLine());
}
string s = File.ReadAllText(path); //直接写报错，写的文件没有关闭
Console.WriteLine(s);





static void A()
{
    using MyFile f2 = new MyFile();
}